import http from "@/http/index.ts"
// 引入计量单位ts类型
import {Unit,UnitListParam} from '@/api/unit/type.ts'


// 新增计量单位
export const addApi = (data: Unit) => {
    return http.post("/unit/createUnit", data)
}


// 分页条件查询列表
export const getListApi = (data:UnitListParam) => {
    return http.get("/unit/getUnitList",data)
}

// 精简列表
export const getUnitSimpleListApi = () => {
    return http.get("/unit/simpleList")
}

// 编辑
export const editApi = (data: Unit) => {
    return http.put("/unit/updateUnit", data)
}


// 删除
export const deleteApi = (id: number) => {
    return http.delete(`/unit/deleteUnit/${id}`)
}

